package com.anthonybennis.blender.client.handlers;


import com.anthonybennis.blender.client.Navigatgor;
import com.anthonybennis.blender.client.Navigatgor.PAGE;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.googlecode.mgwt.dom.client.event.tap.TapEvent;
import com.googlecode.mgwt.dom.client.event.tap.TapHandler;

/**
 * A handler that can be used as a Click and/or TapHandler.
 * @author abennis
 */
public class HomePageTileClickHandler implements ClickHandler, TapHandler
{
	private final PAGE _page;
	private final Navigatgor _navigator;
	
	public HomePageTileClickHandler(PAGE tile, Navigatgor navigator)
	{
		_page = tile;
		_navigator = navigator;
	}
	
	@Override
	public void onClick(ClickEvent event) 
	{
		_navigator.open(_page);		
	}

	@Override
	public void onTap(TapEvent event) 
	{
		_navigator.open(_page);
	}
}